import { Controller, Get, Post, Body, Patch, Param, Delete, HttpCode, UseGuards } from '@nestjs/common';
import { MoviesEpisodeService } from './movies-episode.service';
import { AuthGuard } from '@nestjs/passport';
import { ApiResponse, ApiOperation, ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { MoviesEpisodeEntity } from 'src/modules/admin/movies-episode/entities/movies-episode.entity';
@ApiBearerAuth() // swagger文档设置token
@ApiTags('电影剧情')
@Controller('home/movies-episode')
export class MoviesEpisodeController {
  constructor(private readonly moviesEpisodeService: MoviesEpisodeService) { }

  /** 获取电影剧集列表 */
  @HttpCode(200)
  @Get('/getMoviesEpisode/:id')
  @ApiResponse({
    status: 200,
    description: '电影剧集列表',
    type: MoviesEpisodeEntity,
    isArray: true,
  })
  @ApiOperation({
    tags: ['获取电影剧集'],
    summary: '获取电影剧集列表',
    operationId: 'getMoviesEpisode',
  })
  async getMoviesEpisode(@Param('id') movieId: number,) {
    return this.moviesEpisodeService.getMoviesEpisode(movieId);
  }

  /** 获取电影剧集详情 */
  @HttpCode(200)
  @Get('/getMoviesEpisodeInfo/:id')
  @ApiResponse({
    status: 200,
    description: '电影剧集详情',
    type: MoviesEpisodeEntity,
    isArray: true,
  })
  @ApiOperation({
    tags: ['获取电影剧集'],
    summary: '获取电影剧集详情',
    operationId: 'getMoviesEpisodeInfo',
  })
  async getMoviesEpisodeInfo(@Param('id') movieId: number,) {
    return this.moviesEpisodeService.getMoviesEpisodeInfo(movieId);
  }
}
